pub const IN_ACCESS: u32 = 0x0000_0001;
pub const IN_MODIFY: u32 = 0x0000_0002;
pub const IN_ATTRIB: u32 = 0x0000_0004;
pub const IN_CLOSE_WRITE: u32 = 0x0000_0008;
pub const IN_CLOSE_NOWRITE: u32 = 0x0000_0010;
pub const IN_CLOSE: u32 = IN_CLOSE_WRITE | IN_CLOSE_NOWRITE;
pub const IN_OPEN: u32 = 0x0000_0020;
pub const IN_MOVED_FROM: u32 = 0x0000_0040;
pub const IN_MOVED_TO: u32 = 0x0000_0080;
pub const IN_MOVE: u32 = IN_MOVED_FROM | IN_MOVED_TO;
pub const IN_CREATE: u32 = 0x0000_0100;
pub const IN_DELETE: u32 = 0x0000_0200;
pub const IN_DELETE_SELF: u32 = 0x0000_0400;
pub const IN_MOVE_SELF: u32 = 0x0000_0800;
pub const IN_UNMOUNT: u32 = 0x0000_2000;
pub const IN_Q_OVERFLOW: u32 = 0x0000_4000;
pub const IN_IGNORED: u32 = 0x0000_8000;
pub const IN_ONLYDIR: u32 = 0x0100_0000;
pub const IN_DONT_FOLLOW: u32 = 0x0200_0000;
pub const IN_EXCL_UNLINK: u32 = 0x0400_0000;

pub struct InotifyEvent
{
    pub wd: i32,
    pub mask: u32,
    pub cookie: u32,
    pub len: u32,
}

#[inline(always)]
pub fn inotify_init() -> i32
{
    #[cfg(target_os = "linux")]
    unsafe {
        libc::inotify_init()
    }
    #[cfg(not(target_os = "linux"))]
    -1
}
#[inline(always)]
pub fn inotify_init1(flags: i32) -> i32
{
    #[cfg(target_os = "linux")]
    unsafe {
        libc::inotify_init1(flags)
    }
    #[cfg(not(target_os = "linux"))]
    -1
}
#[inline(always)]
pub fn fanotify_init(flags: u32, event_f_flags: u32) -> i32
{
    #[cfg(target_os = "linux")]
    unsafe {
        libc::fanotify_init(flags, event_f_flags)
    }
    #[cfg(not(target_os = "linux"))]
    -1
}
#[inline(always)]
pub fn inotify_add_watch(fd: i32, path: *const i8, mask: u32) -> i32
{
    #[cfg(target_os = "linux")]
    unsafe {
        libc::inotify_add_watch(fd, path, mask)
    }
    #[cfg(not(target_os = "linux"))]
    -1
}
#[inline(always)]
pub fn inotify_rm_watch(fd: i32, wd: i32) -> i32
{
    #[cfg(target_os = "linux")]
    unsafe {
        libc::inotify_rm_watch(fd, wd)
    }
    #[cfg(not(target_os = "linux"))]
    -1
}
